<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 利用new Object创建对象,利用等号赋值的方法添加属性和方法，用分号分隔
        var obj = new Object();
        obj.uname = '李嘉台';
        obj.age = 18;
        obj.sayHello = function () {
            console.log('hello');
        }
    </script>
</body>

</html>